#region Microsoft Public License
/*
 * (c) Copyright Chenjun Wu. http://utablesdk.codeplex.com
 * 
 * This source is subject to the Microsoft Public License (Ms-PL).
 * Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
 * All other rights reserved.
 */
#endregion

﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Collections.Specialized;

namespace UTable.Objects.Controls
{
    public class ObservableDecorator: Decorator
    {
        public override System.Windows.UIElement Child
        {
            get
            {
                return base.Child;
            }
            set
            {
                if (base.Child != value && ChildrenChanged != null)
                {
                    ChildrenChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, value, base.Child));
                }
                base.Child = value;
            }
        }

        public event NotifyCollectionChangedEventHandler ChildrenChanged;
    }
}
